#ifndef _GDIHELPER_H_
#define _GDIHELPER_H_

#pragma once

//#include <wchar.h>

void GetChildWndPosition(HWND hParentWnd, HWND hChildWnd, LPRECT lpPosRect)
{
	::GetWindowRect(hChildWnd,lpPosRect);
	::MapWindowPoints(NULL,hParentWnd,(LPPOINT)lpPosRect,2);
}

namespace FontHelper
{
	HFONT CreateFont( LPCWSTR fontName, int fontHeight,
		LONG fontWeight = FW_NORMAL, 
		BOOL italic = FALSE, BOOL underline = FALSE, BOOL strikeOut =FALSE )
	{
		CLogFont lf;

		ATLASSERT(::wcslen(fontName)<LF_FACESIZE);
		SecureHelper::strcpy_x(lf.lfFaceName,LF_FACESIZE,fontName);

		lf.lfWeight = fontWeight;
		lf.lfHeight = fontHeight;
		lf.lfItalic = italic;
		lf.lfUnderline = underline;
		lf.lfStrikeOut = strikeOut;

		CFontHandle font;
		font.CreateFontIndirect(&lf);
		return font;
	}
}

#endif